package com.zhentao.dataintegrity.domain.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

public class IntegrityTaskDTO {

    private Long id;

    @NotBlank(message = "任务标题不能为空")
    private String taskTitle;

    @NotEmpty(message = "数据类型不能为空")
    private List<String> dataTypes;

    @NotBlank(message = "时间范围类型不能为空")
    private String timeRangeType;

    @NotBlank(message = "触发方式不能为空")
    private String triggerType;

    private String scheduleType;
    private String scheduleTime;
    private String scheduleCron;
    private String taskStatus;
    private LocalDateTime lastRunTime;
    private LocalDateTime nextRunTime;
    private String lastRunStatus;
    private String lastRunError;
    private BigDecimal lastDiffRmb;
    private BigDecimal lastDiffUsd;
    private LocalDateTime createdTime;
    private LocalDateTime updatedTime;

    // 扩展字段
    private String taskStatusText;
    private String lastRunStatusText;
    private String triggerTypeText;
    private String timeRangeTypeText;
    private List<DataTypeOption> dataTypeOptions;

    // 内部类：数据类型选项
    public static class DataTypeOption {
        private String code;
        private String name;
        private boolean selected;

        public DataTypeOption() {}

        public DataTypeOption(String code, String name, boolean selected) {
            this.code = code;
            this.name = name;
            this.selected = selected;
        }

        public String getCode() { return code; }
        public void setCode(String code) { this.code = code; }

        public String getName() { return name; }
        public void setName(String name) { this.name = name; }

        public boolean isSelected() { return selected; }
        public void setSelected(boolean selected) { this.selected = selected; }
    }

    // Getters and Setters
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }

    public String getTaskTitle() { return taskTitle; }
    public void setTaskTitle(String taskTitle) { this.taskTitle = taskTitle; }

    public List<String> getDataTypes() { return dataTypes; }
    public void setDataTypes(List<String> dataTypes) { this.dataTypes = dataTypes; }

    public String getTimeRangeType() { return timeRangeType; }
    public void setTimeRangeType(String timeRangeType) { this.timeRangeType = timeRangeType; }

    public String getTriggerType() { return triggerType; }
    public void setTriggerType(String triggerType) { this.triggerType = triggerType; }

    public String getScheduleType() { return scheduleType; }
    public void setScheduleType(String scheduleType) { this.scheduleType = scheduleType; }

    public String getScheduleTime() { return scheduleTime; }
    public void setScheduleTime(String scheduleTime) { this.scheduleTime = scheduleTime; }

    public String getScheduleCron() { return scheduleCron; }
    public void setScheduleCron(String scheduleCron) { this.scheduleCron = scheduleCron; }

    public String getTaskStatus() { return taskStatus; }
    public void setTaskStatus(String taskStatus) { this.taskStatus = taskStatus; }

    public LocalDateTime getLastRunTime() { return lastRunTime; }
    public void setLastRunTime(LocalDateTime lastRunTime) { this.lastRunTime = lastRunTime; }

    public LocalDateTime getNextRunTime() { return nextRunTime; }
    public void setNextRunTime(LocalDateTime nextRunTime) { this.nextRunTime = nextRunTime; }

    public String getLastRunStatus() { return lastRunStatus; }
    public void setLastRunStatus(String lastRunStatus) { this.lastRunStatus = lastRunStatus; }

    public String getLastRunError() { return lastRunError; }
    public void setLastRunError(String lastRunError) { this.lastRunError = lastRunError; }

    public BigDecimal getLastDiffRmb() { return lastDiffRmb; }
    public void setLastDiffRmb(BigDecimal lastDiffRmb) { this.lastDiffRmb = lastDiffRmb; }

    public BigDecimal getLastDiffUsd() { return lastDiffUsd; }
    public void setLastDiffUsd(BigDecimal lastDiffUsd) { this.lastDiffUsd = lastDiffUsd; }

    public LocalDateTime getCreatedTime() { return createdTime; }
    public void setCreatedTime(LocalDateTime createdTime) { this.createdTime = createdTime; }

    public LocalDateTime getUpdatedTime() { return updatedTime; }
    public void setUpdatedTime(LocalDateTime updatedTime) { this.updatedTime = updatedTime; }

    public String getTaskStatusText() { return taskStatusText; }
    public void setTaskStatusText(String taskStatusText) { this.taskStatusText = taskStatusText; }

    public String getLastRunStatusText() { return lastRunStatusText; }
    public void setLastRunStatusText(String lastRunStatusText) { this.lastRunStatusText = lastRunStatusText; }

    public String getTriggerTypeText() { return triggerTypeText; }
    public void setTriggerTypeText(String triggerTypeText) { this.triggerTypeText = triggerTypeText; }

    public String getTimeRangeTypeText() { return timeRangeTypeText; }
    public void setTimeRangeTypeText(String timeRangeTypeText) { this.timeRangeTypeText = timeRangeTypeText; }

    public List<DataTypeOption> getDataTypeOptions() { return dataTypeOptions; }
    public void setDataTypeOptions(List<DataTypeOption> dataTypeOptions) { this.dataTypeOptions = dataTypeOptions; }
}
